﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Graphene.Storing
{
    public class PointReal2D : Graphene.Storing.Point
    {
        public PointReal2D() : this(0.0f, 0.0f)
        {
        }

        public PointReal2D(float x, float y)
        {
            this.x = x;
            this.y = y;
        }

        public override bool Equals(Object obj)
        {
            if (obj == null)
            {
                return false;
            }

            PointReal2D p = obj as PointReal2D;
            if ((System.Object) p == null)
            {
                return false;
            }
        
            return (this.x == p.X) && (y == p.Y);
        }

        public bool Equals(PointReal2D p)
        {            
            if ((object) p == null)
            {
                return false;
            }
            
            return (this.x == p.X) && (this.y == p.Y);
        }

        public override int GetHashCode()
        {
            return (int)this.x ^ (int)this.y;
        }

        public float X
        {
            get { return x; }            
        }

        public float Y
        {
            get { return y; }            
        }

        protected float x;
        protected float y;        
    }
}
